#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    string largestNumber(vector<int>& nums) {
        vector<string> strs;
        for (int i : nums) strs.push_back(to_string(i));
        sort(strs.begin(), strs.end(), [](string s1, string s2)
            {
                return s1 + s2 > s2 + s1;
            });
        string ret;
        for (string s : strs) ret += s;
        if (ret[0] == '0') return "0";
        else return ret;
    }
};